#include "lcd.h"
#include "motor.h"


void Menu_show_motor_msg()
{
    LCD_Fill(0, 0, LCD_W, LCD_H, BLACK);
    LCD_ShowString(120, 36, (uint8_t*)"Motor", BRRED, BLACK, 24, 0);
    LCD_ShowString(50, 72, (uint8_t*)"Angle:", BRRED, BLACK, 24, 0);
    LCD_ShowString(50, 96, (uint8_t*)"Speed:", BRRED, BLACK, 24, 0);
    LCD_ShowString(50, 120, (uint8_t*)"Torque:", BRRED, BLACK, 24, 0);
    LCD_ShowString(50, 144, (uint8_t*)"key:", BRRED, BLACK, 24, 0);
    LCD_DrawLine(10, 0, 10, 280, WHITE);
    LCD_DrawLine(270, 0, 270, 280, WHITE);
}

extern uint8_t Key;
extern uint16_t adc_val[1];

void Menu_show_motor_data_refresh()
{
    LCD_ShowFloatNum(150, 72, motor[1].Angle, 5, 1, WHITE, BLACK, 16);
    LCD_ShowFloatNum(150, 96, motor[1].Speed, 5, 1, WHITE, BLACK, 16);
    LCD_ShowFloatNum(150, 120, motor[1].Torque, 5, 1, WHITE, BLACK, 16);
    LCD_ShowIntNum(150, 144, Key, 2, WHITE, BLACK, 16);
    LCD_ShowIntNum(200, 144, adc_val[0], 5, WHITE, BLACK, 16);
    LCD_ShowIntNum(150, 168, motor[1].enable_state, 5, WHITE, BLACK, 16);
}
